SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE [dbo].[ReindexadoTablasJuntas] AS

--Tetas
SET NOCOUNT ON
CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_TitulosDelAgente] ON [dbo].[tb_TitulosDelAgente] ([idTitulo])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idx_AgentesTitulosDelAgente] ON [dbo].[tb_TitulosDelAgente] ([Agente])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_ConceptosDePuntaje] ON [dbo].[tb_ConceptosDePuntaje] ([idConcepto])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [ind_tipoConvocatoriaConcepto] ON [dbo].[tb_ConceptosDePuntaje] ([TipoConvocatoria])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_CategoriasDeTitulo] ON [dbo].[tb_CategoriasDeTitulo] ([idCategoria])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_Antecedentes] ON [dbo].[tb_Antecedentes] ([idAntecedente])
WITH
    DROP_EXISTING
ON [PRIMARY]


CREATE 
  INDEX [idxAntecedentesAgentes] ON [dbo].[tb_Antecedentes] ([Agente])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_TiposAntecedentes] ON [dbo].[tb_TiposAntecedentes] ([idTipoAntecedente])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idxRubroEnTipAntec] ON [dbo].[tb_TiposAntecedentes] ([Rubro])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_TopeTiposAntecedentes] ON [dbo].[tb_TopeTiposAntecedentes] ([IdTope])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idx_TopetipoAntRubro] ON [dbo].[tb_TopeTiposAntecedentes] ([Rubro])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_Agentes] ON [dbo].[tb_Agentes] ([idAgente])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idxDocumentoAgente] ON [dbo].[tb_Agentes] ([Documento])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_AsignaturasGenericas] ON [dbo].[tb_AsignaturasGenericas] ([idAsignaturaGenerica])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_CargosGenericos] ON [dbo].[tb_CargosGenericos] ([idCargoGenerico])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_CalificacionesDeInscripcion] ON [dbo].[tb_CalificacionesDeInscripcion] ([idCalificacionInscripcion])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idxInscripcionConvocatoria] ON [dbo].[tb_CalificacionesDeInscripcion] ([Inscripcion])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idx_califConcepto] ON [dbo].[tb_CalificacionesDeInscripcion] ([Concepto])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [PK_tb_InscripcionesConvocatorias] ON [dbo].[tb_InscripcionesConvocatorias] ([idInscripcionConvocatoria])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idxAgentedelaInscConvocatoria] ON [dbo].[tb_InscripcionesConvocatorias] ([Agente])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idx_inscripConvoc] ON [dbo].[tb_InscripcionesConvocatorias] ([Convocatoria])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idx_inscrCargo] ON [dbo].[tb_InscripcionesConvocatorias] ([CargoGenerico])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE 
  INDEX [idx_inscAsig] ON [dbo].[tb_InscripcionesConvocatorias] ([AsignaturaGenerica])
WITH
    DROP_EXISTING
ON [PRIMARY]

CREATE UNIQUE CLUSTERED
  INDEX [idx_detallePuntajes] ON [dbo].[tb_DetallePuntajes] ([id])
WITH
    DROP_EXISTING
ON [PRIMARY]
GO
